package com.tianhui.consignortwofei.mvp.ui.adapter;

import android.content.Context;
import android.view.ViewGroup;
import android.widget.TextView;

import com.amap.api.services.core.PoiItemV2;
import com.tianhui.consignortwofei.R;

import org.yczbj.ycrefreshviewlib.adapter.RecyclerArrayAdapter;
import org.yczbj.ycrefreshviewlib.holder.BaseViewHolder;

/**
 * @author fgs
 * @date 2021/1/21
 * @description
 **/
public class PopDressGaoDeListAdapter extends RecyclerArrayAdapter<PoiItemV2> {

    public PopDressGaoDeListAdapter(Context context) {
        super(context);
    }


    @Override
    public BaseViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) {
        return new PopDressListViewHolder(parent, R.layout.item_pop_dress);
    }

    private class PopDressListViewHolder extends BaseViewHolder<PoiItemV2> {

        private TextView item_text;
        private TextView tv_xiangxi;
//        private ImageView checkImageView;

        public PopDressListViewHolder(ViewGroup parent, int res) {
            super(parent, res);
            item_text = getView(R.id.item_text);
            tv_xiangxi = getView(R.id.tv_xiangxi);
//            checkImageView = getView(R.id.item_consignor_list_checkImageView);
        }

        @Override
        public void setData(PoiItemV2 data) {
            super.setData(data);
            item_text.setText(data.getTitle());
            tv_xiangxi.setText(data.getSnippet());
//            String consignorId = SharedPreferenceManager.getInstance().getConsignorId();
//            if (!TextUtils.isEmpty(consignorId) && consignorId.equals(data.useId)) {
//                checkImageView.setVisibility(View.VISIBLE);
//            } else {
//                checkImageView.setVisibility(View.GONE);
//            }

        }
    }
}
